package com.liu.cloud.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;

import java.util.UUID;

/**
 * yml配置文件中指定拦截器
 * @author LIU
 * @version 1.0
 * @description: TODO
 * @date 2023/6/18 17:09
 */
public class feignRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        String uuid = UUID.randomUUID().toString();
        requestTemplate.header("Authorization", uuid);
        System.out.println("拦截器执行了,设置了Authorization" + uuid);
    }
}
